import axios from "axios";
import { baseURL_dev } from '@/config/baseURL'
//初始化一个axios对象
const instance = axios.create({
    baseURL: baseURL_dev,
    /* timeout: 1000,
    headers: {
        'X-Custom-Header': 'foobar'
    } */
});
//get请求
export const $get = async (api: string, params: object = {}) => {
    const { data } = await instance.get(api, params)
    return data
}
//post请求
export const $post = async (api: string, params: object = {}) => {
    const { data } = await instance.post(api, params)
    return data
}